package com.py.od.mapper;

import java.util.List;

import com.py.od.domain.*;
import org.apache.ibatis.annotations.Param;

/**
 * 库存调拨Mapper接口
 * 
 * @author py
 * @date 2024-12-04
 */
public interface OdInventoryTransferMapper
{
    /**
     * 查询库存调拨
     *
     * @param inventoryTransferId 库存调拨主键
     * @return 库存调拨
     */
    public OdInventoryTransfer selectOdInventoryTransferByInventoryTransferId(Long inventoryTransferId);

    /**
     * 查询库存调拨列表
     *
     * @param odInventoryTransfer 库存调拨
     * @return 库存调拨集合
     */
    public List<OdInventoryTransfer> selectOdInventoryTransferList(OdInventoryTransfer odInventoryTransfer);

    // 查询库存的商品信息
    public WhInventory seleWhInventory(WhInventory whInventory);

    // 当仓库没有这条商品信息则添加
    public int WhlnaddAll(WhInventory whInventory);
    // 当仓库有这条商品信息则修改
    public int DcWhlnupdate(WhInventory whInventory);
    public int DlWhlnupdate(WhInventory whInventory);

    List<OdTransferDetails> selectByNumberList(OdTransferDetails odTransferDetails);

    public List<BsWhLocation> selectAllBsWhLocation(@Param("wid") Integer wid);
    //根据库位编号商品编号查询库存
    public List<WhInventory> selectWhInventoryByCode(WhInventory whInventory);

    public OdWarehouse selectOdWarehouse(int warehouseId);

    /**
     * 新增库存调拨selectOdInventoryTransferByInventoryTransferId
     *
     * @param odInventoryTransfer 库存调拨
     * @return 结果
     */
    public int insertOdInventoryTransfer(OdInventoryTransfer odInventoryTransfer);

    public int insertOdTransferDetails(OdTransferDetails odTransferDetails);

    /**
     * 修改库存调拨
     *
     * @param odInventoryTransfer 库存调拨
     * @return 结果
     */
    public int updateOdInventoryTransfer(OdInventoryTransfer odInventoryTransfer);

    public int  updateOdTransferDetails(OdTransferDetails odTransferDetails);
    public int updatestatus(OdInventoryTransfer odInventoryTransfer);
    public int updateKuc(OdTransferDetails odTransferDetails);

    /**
     * 删除库存调拨
     *
     * @param inventoryTransferId 库存调拨主键
     * @return 结果
     */
    public int deleteOdInventoryTransferByInventoryTransferId(Long inventoryTransferId);

    /**
     * 批量删除库存调拨
     *
     * @param inventoryTransferIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteOdInventoryTransferByInventoryTransferIds(Long[] inventoryTransferIds);

    /**
     * 批量删除调拨明细
     *
     * @param inventoryTransferIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteOdTransferDetailsByTransferNumbers(String [] inventoryTransferIds);

    /**
     * 批量新增调拨明细
     *
     * @param odTransferDetailsList 调拨明细列表
     * @return 结果
     */
    public int batchOdTransferDetails(List<OdTransferDetails> odTransferDetailsList);






    /**
     * 通过库存调拨主键删除调拨明细信息
     *
     * @param transferNumber 库存调拨ID
     * @return 结果
     */
    public int deleteOdTransferDetailsByTransferNumber(String transferNumber);

    SysUser selectBySysUserName( @Param("userName") String userName );

    int deleteDetailsByCode(@Param("transferNumber") String transferNumber);

//    public OdInventoryTransfer od(@Param(("transferDetailId")int ))
}
